<template>
    <div>
        <StElDynamicForm
                @change="(form)=>{selectedAppCode = form.appCode}"
                :submit-props="{method: 'get',url: $stStringTools.replaceb(MpUrl.MpTempMsgIndustryGet,{appCode: selectedAppCode}),label: '确认获取'}"
                :options="formItems" :origin-prop="{inline: true,labelWidth: '100px'}"
                @requestSuccess="submitSuccess"

        ></StElDynamicForm>
        <el-form v-if="industryInfo">
            <el-form-item label="主行业编码">
                {{industryInfo.primaryIndustry}}
            </el-form-item>
            <el-form-item label="主行业名称">
                {{industryInfo.primaryIndustryName}}
            </el-form-item>
            <el-form-item label="主行业类别">
                {{industryInfo.primaryIndustryClass}}
            </el-form-item>
            <el-form-item label="副行业编码">
                {{industryInfo.secondIndustry}}
            </el-form-item>
            <el-form-item label="副行业名称">
                {{industryInfo.secondIndustryName}}
            </el-form-item>
            <el-form-item label="副行业类别">
                {{industryInfo.secondIndustryClass}}
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    import MpMixin from '../MpMixin.js'
    import MpUrl from '../MpUrl.js'
    export default {
        name: 'MpTempMsgIndustryGet',
        mixins:[MpMixin],
        components:{
        },
        data(){
            return {
                selectedAppCode: '',
                industryInfo: null,
                formItems:[
                    {
                        field: {
                            name: 'appCode'
                        },
                        element:{
                            type: 'select',
                            required: true,
                            options:{
                                datas: MpUrl.configList,
                                optionProp:{
                                    value: 'appCode',
                                    label: 'appName'
                                }
                            },
                            label: '公众号',
                        }
                    },
                ]
            }
        },
        methods:{
            submitSuccess(data) {
                this.industryInfo = data
            },
        }
    }
</script>

<style scoped>

</style>